package com.office.automate.frontier.utility;

import java.util.HashMap;

import com.office.automate.exception.framework.FrontierVisibleException;

public class ExceptionMessagesManagement {

	private HashMap<String, FrontierVisibleException> exceptionMessagesList;

	public ExceptionMessagesManagement(
			HashMap<String, FrontierVisibleException> exceptionMessagesList) {
		this.exceptionMessagesList = exceptionMessagesList;
	}

	public HashMap<String, FrontierVisibleException> getExceptionMessagesList() {
		return exceptionMessagesList;
	}

	public void setExceptionMessagesList(
			HashMap<String, FrontierVisibleException> exceptionMessagesList) {
		this.exceptionMessagesList = exceptionMessagesList;
	}

	public boolean checkExistenceOfErrorByKey(String aKey) {
		try {
			FrontierVisibleException exception = exceptionMessagesList.get(aKey);
		} catch (Exception e) {
			return false;
		}
		return true;
	}

	public String getDetailExceptionMessage(String aKey) {
		try {
			FrontierVisibleException exception = exceptionMessagesList.get(aKey);
			return exception.getDetailsErrorMessage();			
		} catch (Exception e) {
			return "";
		}
	}
}